---------------------------------------------------------------------------------------------------
-- func: @addfewell <amount> <FewellType> <player>
-- auth: Forgottenandlost
-- desc: Adds specified amount and type of Synergy Fewell to the player
--       0 = Fire, 1 = Ice, 2 = Wind, 3 = Earth,
--       4 = Lightning, 5 = Water, 6 = Light, 7 = Dark
---------------------------------------------------------------------------------------------------

cmdprops =
{
    permission = 1,
    parameters = "iis"
};

function onTrigger(player,amount,FewellType,target)

    if (amount == nil) then
        player:PrintToPlayer( "You must enter a valid point amount." );
        player:PrintToPlayer( "@addfewell <amount> <FewellType> <player>" );
        return;
    end

    if (FewellType == nil) then
        player:PrintToPlayer( "You must enter a valid Fewell FewellType." );
        player:PrintToPlayer( "@addfewell <amount> <FewellType> <player>" );
        player:PrintToPlayer( "FewellTypes: 0 = Fire, 1 = Ice, 2 = Wind, 3 = Earth..." );
        player:PrintToPlayer( "...4 = Lightning, 5 = Water, 6 = Light, 7 = Dark" );
        return;
    end

    if (target == nil) then
        player:addFewell(amount, FewellType);
    else
        local targ = GetPlayerByName(target);
        if (targ ~= nil) then
            targ:addFewell(amount, FewellType);
        else
            player:PrintToPlayer( string.format( "Player named '%s' not found!", target ) );
            player:PrintToPlayer( "@addfewell <amount> <FewellType> <player>" );
        end
    end
end;